﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CaiyinSoft.NetGather.Protocol;

namespace CaiyinSoft.NetGather.NetGatherLib.Filter.Process
{
    public partial class P000_SimpleReplaceHTMLAnalyzeForm : InnerFormBase
    {
        public P000_SimpleReplaceHTMLAnalyzeForm()
        {
            InitializeComponent();
        }


        public SimpleReplaceHTMLAnalyze _HTMLFilter;
        public SimpleReplaceHTMLAnalyze HTMLFilter
        {
            get
            {
                if (_HTMLFilter == null)
                {
                    return null;
                }
                else
                {
                    _HTMLFilter.RunOnce = RunOnce;
                    _HTMLFilter.OutputKey = OutputKey;
                    _HTMLFilter.ReplaceFrom = ReplaceFrom;
                    _HTMLFilter.ReplaceTo = ReplaceTo;
                    return _HTMLFilter;
                }
            }
            set
            {
                _HTMLFilter = value;
                if (value != null)
                {
                    labTitle.Text = value.FilterCaption;
                    txtDescription.Text = value.Description;
                    RunOnce = value.RunOnce;
                    OutputKey = value.OutputKey;
                    ReplaceFrom = value.ReplaceFrom;
                    ReplaceTo = value.ReplaceTo;
                }
            }
        }

        public bool RunOnce
        {
            get
            {
                return chkRunOnce.Checked;
            }
            set
            {
                chkRunOnce.Checked = value;
            }
        }


        public string OutputKey
        {
            get
            {
                return txtOutKey.Text;
            }
            set
            {
                txtOutKey.Text = value;
            }
        }

        public string ReplaceFrom
        {
            get
            {
                return txtReplaceFrom.Text;
            }
            set
            {
                txtReplaceFrom.Text = value;
            }
        }

        public string ReplaceTo
        {
            get
            {
                return txtReplaceTo.Text;
            }
            set
            {
                txtReplaceTo.Text = value;
            }
        }

        private void P000_SimpleReplaceHTMLAnalyzeForm_Load(object sender, EventArgs e)
        {

        }
    }
}
